<br /><br />
<div id="view-content">
    Détails des frais par Visiteurs
    <table border="1">
        <thead>
        <td style="padding-right: 200px;">IdVisiteur</td>
        <td>Mois</td>
        <td>ETP</td>
        <td>KM</td>
        <td>NUI</td>
        <td>REP</td>
        </thead>
        <?php
        $visiteurCourant = $this->lesStats[0]["idVisiteur"];
        $ETPtotal = 0;
        $KMtotal = 0;
        $NUItotal = 0;
        $REPtotal = 0;
        for ($i = 0; $i < sizeof($this->lesStats); $i++) {
            if ($this->lesStats[$i]["idVisiteur"] == $visiteurCourant) {
                $ETPtotal = $ETPtotal + $this->lesStats[$i]["ETP"];
                $KMtotal = $KMtotal + $this->lesStats[$i]["KM"];
                $NUItotal = $NUItotal + $this->lesStats[$i]["NUI"];
                $REPtotal = $REPtotal + $this->lesStats[$i]["REP"];
            } else {

                echo"<tr style='background-color:#eee353;'>
                 <td>Visiteur: " . $visiteurCourant . " </td>
                 <td> </td>
                 <td>ETP: " . $ETPtotal . "</td>
                 <td>KM: " . $KMtotal . "</td>
                 <td>NUI: " . $NUItotal . "</td>
                 <td>REP: " . $REPtotal . "</td>
              </tr>";
                $ETPtotal = $this->lesStats[$i]["ETP"];
                $KMtotal = $this->lesStats[$i]["KM"];
                $NUItotal = $this->lesStats[$i]["NUI"];
                $REPtotal = $this->lesStats[$i]["REP"];
            }
            echo "<tr>
              <td>" . $this->lesStats[$i]["idVisiteur"] . "</td>
              <td>" . $this->lesStats[$i]["mois"] . "</td>
              <td>ETP: " . $this->lesStats[$i]["ETP"] . "</td>
                 <td>KM: " . $this->lesStats[$i]["KM"] . "</td>
                 <td>NUI: " . $this->lesStats[$i]["NUI"] . "</td>
                 <td>REP: " . $this->lesStats[$i]["REP"] . "</td>
              </tr>";


            $visiteurCourant = $this->lesStats[$i]["idVisiteur"];
        }
        echo"<tr style='background-color:#eee353;'>
                 <td>Visiteur: " . $visiteurCourant . " </td>
                 <td> </td>
                 <td>ETP: " . $ETPtotal . "</td>
                 <td>KM: " . $KMtotal . "</td>
                 <td>NUI: " . $NUItotal . "</td>
                 <td>REP: " . $REPtotal . "</td>
              </tr>";
        ?>
    </table>
</div>